{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 一.用户输入查询日期和时间，可返回对应的课表信息；用户查询当前时间，可返回当前课表信息。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "####  1.用户输入查询日期和时间，可返回对应的课表信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "周几？（请输入中文汉字）:一\n",
      "何时?10\n",
      "几分?26\n",
      "星期一的10:26\n",
      "python语言\n"
     ]
    }
   ],
   "source": [
    "\n",
    "day = input(\"周几？（请输入中文汉字）:\")\n",
    "hour = input(\"何时?\")\n",
    "minute = input(\"几分?\")\n",
    "now = int(hour + minute)\n",
    "\n",
    "print(\"星期{}的{}:{}\".format(day, hour, minute))\n",
    "\n",
    "if day == \"一\":\n",
    "    if 945 < now < 1200:\n",
    "        print(\"python语言\")\n",
    "    elif 1430 < now < 1555:\n",
    "        print(\"太极拳\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "elif day == \"二\":\n",
    "    if 800 < now < 1025:\n",
    "        print(\"用户研究\")\n",
    "    elif 1035< now < 1200:\n",
    "        print(\"毛概实践\")\n",
    "    elif 1400 < now < 1555:\n",
    "        print(\"新媒体时代的新闻评论\")\n",
    "        print(\"毛概实践\")\n",
    "    elif 1845 < now < 2055:\n",
    "        print(\"毛概\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "elif day == \"三\":\n",
    "    if 800 < now < 930:\n",
    "        print(\"大英\")\n",
    "    elif 945 < now < 1200:\n",
    "        print(\"融合新闻学\")\n",
    "    elif 1845 < now < 2055:\n",
    "        print(\"Excel数据分析\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "elif day == \"四\":\n",
    "    if 1400 < now < 1555:\n",
    "        print(\"广告文案写作\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "elif day == \"五\":\n",
    "    if 800 < now < 930:\n",
    "        print(\"大英\")\n",
    "    elif 945 < now < 1200:\n",
    "        print(\"创业基础实践\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "else:\n",
    "    print(\"你正在放假！\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.用户查询当前时间，可返回当前课表信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "现在时间10:39\n",
      "python语言\n"
     ]
    }
   ],
   "source": [
    "# 用户查询当前时间，可返回当前课表信息\n",
    "\n",
    "import time\n",
    "\n",
    "today = time.strftime(\"%A\")\n",
    "now = int(time.strftime(\"%H%M\"))\n",
    "\n",
    "print(\"现在时间{}\".format(time.strftime(\"%H:%M\")))\n",
    "if today == \"Monday\":\n",
    "    if 945 < now < 1200:\n",
    "        print(\"python语言\")\n",
    "    elif 1430 < now < 1555:\n",
    "        print(\"太极拳\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "elif today == \"Tuesday\":\n",
    "    if 800 < now < 1025:\n",
    "        print(\"用户研究\")\n",
    "    elif 1035< now < 1200:\n",
    "        print(\"毛概实践\")\n",
    "    elif 1400 < now < 1555:\n",
    "        print(\"新媒体时代的新闻评论\")\n",
    "        print(\"毛概实践\")\n",
    "    elif 1845 < now < 2055:\n",
    "        print(\"毛概\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "elif today == \"Wednesday\":\n",
    "    if 800 < now < 930:\n",
    "        print(\"大英\")\n",
    "    elif 945 < now < 1200:\n",
    "        print(\"融合新闻学\")\n",
    "    elif 1845 < now < 2055:\n",
    "        print(\"Excel数据分析\")\n",
    "    else:\n",
    "        print(\"你还没有课。\")\n",
    "elif today == \"Thursday\":\n",
    "    if 1400 < now < 1555:\n",
    "        print(\"广告文案写作\")\n",
    "elif today == \"Friday\":\n",
    "      if 800 < now < 930:\n",
    "        print(\"大英\")\n",
    "elif 945 < now < 1200:\n",
    "        print(\"创业基础实践\")\n",
    "else:\n",
    "        print(\"你还没有课。\")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 二.完善课程表，增加用户输入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Author:Ruihan\n",
    "## 完善系统的课程表\n",
    "\n",
    "\n",
    "import time\n",
    "import calendar\n",
    "\n",
    "nowTime = time.strftime(\"%Y-%m-%d %H:%M %A\")\n",
    "print(\"当前时间是:\", nowTime)\n",
    "\n",
    "user_name =[Ruihan]\n",
    "user_password =\"123456\"\n",
    "vip_user_name=[\"Linda\"]\n",
    "vip = 10\n",
    "count = 5\n",
    "kk=0\n",
    "\n",
    "while True:\n",
    "    username = input(\"请输入您的账号:\")\n",
    "    password = input(\"请输入您的密码:\")\n",
    "    if username in user_name:\n",
    "        if password in user_password:\n",
    "            print(\"欢迎用户\", username, \"登陆系统使用\")\n",
    "            count = 10\n",
    "            kk = 1\n",
    "            break\n",
    "        elif password in vip_user_name:\n",
    "            print(\"欢迎vip用户\", username, \"登陆系统使用\")\n",
    "            count = 5\n",
    "            kk = 1\n",
    "            break\n",
    "\n",
    "        else:\n",
    "            if count == 1:\n",
    "                print(\"啊哦！密码错啦，账号已锁定\")\n",
    "                break\n",
    "            else:\n",
    "                count -= 1\n",
    "                print(\"您输入的密码不正确，请重新输入，您还有\", count, \"次机会\")\n",
    "    else:\n",
    "        if count == 1:\n",
    "            print(\"账号又错了呀，换个号试试吧\")\n",
    "            break\n",
    "        else:\n",
    "            count -= 1\n",
    "            print(\"您输入的账号不正确，请重新输入，您还有\", count, \"次机会\")\n",
    "\n",
    "while True:\n",
    "                time = input(\"你想查询星期几的课程表：\")\n",
    "                week_time = int(time)\n",
    "                print(week_time)\n",
    "                if week_time == 1:\n",
    "                    print(\"星期一有两节课\");\n",
    "                    print(\"3-5节 Python语言\");\n",
    "                    print(\"8-9节 大学体育 一起来武术吧！\");\n",
    "                    count -= 1\n",
    "                    print(\"你还有\", count, \"的次数\")\n",
    "                elif week_time == 2:\n",
    "                    print(\"星期二有四节课\");\n",
    "                    print(\"1-3节 用户研究\");\n",
    "                    print(\"4-5节 毛概实践\");\n",
    "                    print(\"8-9节 新媒体时代的新闻评论\");\n",
    "                    print(\"12-14节 毛概\");\n",
    "                    count -= 1\n",
    "                    print(\"你还有\", count, \"的次数\")\n",
    "                elif week_time == 3:\n",
    "                    print(\"星期三有三节课\");\n",
    "                    print(\"1-2节 大英\");\n",
    "                    print(\"3-5节 融合新闻学\");\n",
    "                    print(\"12-14节 Excel\");\n",
    "                    count -= 1\n",
    "                    print(\"你还有\", count, \"的次数\")\n",
    "                elif week_time == 4:\n",
    "                    print(\"星期四有一节课\");\n",
    "                    print(\"8-9节 广告文案写作\");\n",
    "                    count -= 1\n",
    "                    print(\"你还有\", count, \"的次数\")\n",
    "                elif week_time == 5:\n",
    "                    print(\"星期五有两节课\");\n",
    "                    print(\"1-2节 大英\");\n",
    "                    print(\"3-5节 创业基础实践\");\n",
    "                    count -= 1\n",
    "                    print(\"你还有\", count, \"的次数\")\n",
    "                else:\n",
    "                    print(\"周末要来啦！\");\n",
    "                    print(\"周末愉快\");\n",
    "                    print(\"OVER\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
